package com.itheima.reggie.entity;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.itheima.reggie.common.LocalDateTimeConverte;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

@Data
public class Employee implements Serializable {
    @ExcelIgnore
    private static final long serialVersionUID = 1L;

    @ExcelProperty("员工id")
    private Long id;

    @ExcelProperty("账号")
    private String username;

    @ExcelProperty("姓名")
    private String name;

    @ExcelIgnore
    private String password;

    @ExcelProperty("手机号码")
    @ColumnWidth(15)
    private String phone;

    @ExcelProperty("性别")
    private String sex;

    @ExcelIgnore
    private String idNumber; //驼峰命名法 ---> 映射的字段名为 id_number

    @ExcelProperty("状态")
    private Integer status;

    //创建时间
    @ExcelProperty(value = "创建时间",converter = LocalDateTimeConverte.class)
    @ColumnWidth(20)
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;


    //更新时间
    @ExcelProperty(value = "更新时间",converter = LocalDateTimeConverte.class)
    @ColumnWidth(20)
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;


    //创建人
    @TableField(fill = FieldFill.INSERT)
    @ExcelProperty("创建人")
    private Long createUser;


    //修改人
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @ExcelProperty("修改人")
    private Long updateUser;

}
